package edu.gyu.myshop.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author ls
 * @since 2024-06-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Myuser implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String username;

    private String password;
    // 构造函数
    public Myuser() {}

    public Myuser(String username, String password, int type) {
        this.username = username;
        this.password = password;
        this.type = type;
        this.createTime = LocalDateTime.now(); // 自动设置创建时间
    }
    /**
     * 0 客户 1 管理员
     */
    private Integer type;
    private LocalDateTime createTime; // 使用 LocalDateTime 类型来表示日期时间

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
}
